<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>RVM : Using buildit</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            RVM : Using buildit
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Apr 07, 2008 by <font color="#0050B2">steveblackburn</font>.
				    </div>

				    <h1><a name="Usingbuildit-Overview"></a>Overview</h1>

<p>The buildit script is a handy way to build and test the system.&nbsp; It has countless features and options to make building and testing really easy, particularly in a multi-machine environment, where you edit on one machine and build and test on others.&nbsp; If you really want to get the most of it, take a look at all the options by running:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit -h
</pre>
</div></div>
<p>...or read the script itself.</p>

<h1><a name="Usingbuildit-Examples"></a>Examples</h1>

<p>Here we just provide a hand full of examples of how it is often used, first for <b>building</b> and secondly for <b>testing</b> (which includes building).&nbsp; Please add to the list if you have other really useful ways of using it.&nbsp; In the examples below, we'll use three hypothetical hosts: <b>habanero</b> (your desktop), <b>jalapeno</b> (a remote x86 machine) and <b>chipotle</b> (a remote PowerPC machine).</p>

<h2><a name="Usingbuildit-Building"></a>Building</h2>

<p>To build a production image on your desktop, <em>habanero</em>, do the following:&nbsp;</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit habanero production
</pre>
</div></div>
<p>Or <em>equivalently</em>:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit localhost production
</pre>
</div></div>
<p>To build a production image on the remote machine <em>jalapeno</em>, do the following:&nbsp;</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno production
</pre>
</div></div>

<h4><a name="Usingbuildit-CrossPlatformBuilding%26nbsp%3B"></a>Cross Platform Building&nbsp;</h4>

<p>To build a production image on the remote PowerPC machine <em>chipotle</em>, do the following:&nbsp;</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit chipotle production
</pre>
</div></div>
<p>Since building on a PowerPC machine can take a long time, you might prefer to build on your x86 machine <em>jalapeno</em> and cross-build to <em>chipotle</em>.&nbsp; In that case you would just do the following:&nbsp;</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno -c chipotle production
</pre>
</div></div>
<p>In each case, buildit figures out the host types by interrogating them and does the right thing (forcing a PPC build on the x86 host jalapeno since you've told it you want a build for chipotle, which it knows is PPC).&nbsp; Buildit caches the host information, and will prompt you the first time it encounters a new host.&nbsp;</p>

<h4><a name="Usingbuildit-FullBuildSpecification%26nbsp%3B"></a>Full Build Specification&nbsp;</h4>

<p>If you want to specify the build fully, you can do something like this:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno FastAdaptive MarkSweep
</pre>
</div></div>
<p>If you want to specify multiple different GCs you could do:
<br class="atl-forced-newline" /></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno FastAdaptive MarkSweep SemiSpace GenMS
</pre>
</div></div>
<p>which would build all three configurations on jalapeno.
<br class="atl-forced-newline" /></p>

<h4><a name="Usingbuildit-ProfiledBuilds"></a>Profiled Builds</h4>

<p>Jikes RVM has the capacity to profile the boot image and then re-build an optimized boot image based on the profiles.&nbsp; This process takes a little longer, but results in measurably faster builds, and so should be used when doing performance testing.&nbsp; Buildit lets you do this trivially:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno --profile production
</pre>
</div></div>

<h2><a name="Usingbuildit-Testing"></a>Testing</h2>

<p>Jikes RVM currently has a notion of a "<b>test-run</b>", which defines a complete test scenario, including tests and builds.&nbsp; An example is <em>pre-commit</em>, which runs a small suite of pre-commit tests.&nbsp; It also has the notion of a "<b>test</b>", which just specifies a particular set of tests, not the full scenario.&nbsp; An example is <em>dacapo</em>, which just runs the <a href="http://dacapo-bench.org">DaCapo</a> test suite (see the testing/tests directory for the available tests).</p>

<h4><a name="Usingbuildit-Runningatestrun"></a>Running a test-run</h4>

<p>To run the pre-commit test-run on your host jalapeno just do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno --test-run pre-commit jalapeno
</pre>
</div></div>

<h4><a name="Usingbuildit-Runningatest"></a>Running a test</h4>

<p>To run the dacapo tests against a production on the host jalapeno, do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno -t dacapo production
</pre>
</div></div>
<p>To run the dacapo tests against a FastAdaptive MarkSweep build, on the host jalapeno, do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno -t dacapo FastAdaptive MarkSweep
</pre>
</div></div>
<p>&nbsp;To run the dacapo and SPECjvm98 tests against production on the host jalapeno, do:
<br class="atl-forced-newline" /></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bin/buildit jalapeno -t dacapo -t SPECjvm98 production
</pre>
</div></div>
<p><br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<br class="atl-forced-newline" /></p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://docs.codehaus.org/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Jul 04, 2010 19:57</font></td>
		    </tr>
	    </table>
    </body>
</html>